package Homework;

public class MyThread2 {
    private int j;

    public synchronized void increaceJ() {// 做加一操作
        j++;
        System.out.println(Thread.currentThread().getName() + "对j加一后；j=" + j);
    }

    public synchronized void decreaceJ() {// 做减一操作
        j--;
        System.out.println(Thread.currentThread().getName() + "对j减一后；j=" + j);
    }
}
